<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<script src="https://www.dzwww.com/tpl/v5/jquery-1.9.1.min.js" type="text/javascript"></script>
</head>
<body>
	<button id="test">获取消息</button>
	<script>
		$("#test").click(function(){
			var defer = $.ajax({
				headers: {
			        Accept: "application/json; charset=utf-8"
			    },
				url:'http://localhost:3000/tool/count/5aa8ddf6f01a70ae10fee28d'
			});
			$.when(defer).done(function(res){
				console.log(res)
			}).fail(function(res){
				console.log('fail')
				console.log(res);
			})
		})
	</script>
</body>
</html>